package org.jiamandan.com.controller;


import lombok.AllArgsConstructor;
import org.jiamandan.com.service.IRechargePileService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor
@RequestMapping("/car")
public class CarTestController {

    private IRechargePileService iRechargePileService;

    /**
     * 下发计费模型
     * @param pileNo  设备编号
     * @param gunNo   充电枪号
     * @return
     */
    @GetMapping("/testIssueModel")
    public String testIssueModel(@RequestParam String pileNo, @RequestParam String gunNo){
        iRechargePileService.testIssueModel(pileNo,gunNo);
        return "下发成功";
    }


    /**
     * 远程下发充电
     * @param pileNo  设备编号
     * @param gunNo   充电枪号
     * @return
     */
    @GetMapping("/testCharge")
    public String testCharge(@RequestParam String pileNo, @RequestParam String gunNo){
        iRechargePileService.testCharge(pileNo,gunNo);
        return "下发成功";
    }


    /**
     * 远程停止充电
     * @param pileNo  设备编号
     * @param gunNo   充电枪号
     * @return
     */
    @GetMapping("/testStopCharge")
    public String testStopCharge(@RequestParam String pileNo, @RequestParam String gunNo){
        iRechargePileService.testStopCharge(pileNo,gunNo);
        return "下发成功";
    }
}
